import request from "../utils/request";

//用户登录接口
export function adminLoginFn(params) {
  return request({
    url: "admin/login",
    method: "post",
    data: params,
  });
}

//获取管理员列表数据
export function getAdminlist() {
  return request({
    url: "admin/list",
  });
}

//获取管理员信息
export function getAdminDetail(adminname) {
  return request({
    url: "admin/detail",
  });
}
//添加管理员   params {adminname password role checkedKeys}
export function addAdmin(params) {
  console.log("addadmin api--->", params);
  return request({
    url: "admin/add",
    method: "post",
    data: params,
  });
}
//删除管理员
export function deleteAdmin(adminid) {
  return request({
    url: "admin/delete",
    method: "post",
    data: adminid,
  });
}
//编辑管理员   params {adminname password role checkedKeys}
export function editAdmin(params) {
  return request({
    url: "admin/update",
    method: "post",
    data: params,
  });
}
